package accesoADatos;
import java.sql.*;

public class SqlQuery {
	
	public Connection conexion;
	public PreparedStatement consulta;
	public ResultSet datos;
	
	public void conectar(String servidor, String bd, String usurio, String password) throws ClassNotFoundException, SQLException 
	{
		Class.forName("com.mysql.jdbc.Driver");
		this.conexion = DriverManager.getConnection("jdbc:mysql://localhost/pos", "root", "");
	}
	
	public void desconectar() throws SQLException
	{
		this.conexion.close();
		//this.consulta.close();
	}
	
	public void desconectar(ResultSet rs) throws SQLException
	{
		this.desconectar();
		rs.close();
	}
}